
package cn.hz.camel;

import java.io.Serializable;
import java.sql.Timestamp;
import java.util.Date;
import java.util.List;
import java.util.concurrent.LinkedBlockingQueue;

 

public class MzClientInput  {
   private String key;
 
   private   LinkedBlockingQueue inQu=new LinkedBlockingQueue();
   private   LinkedBlockingQueue outQu=MzSource.outQu;;
   
   private MzHandle inHandle;
   
   public void exe(){
	   MzResult obj=inHandle.handle1();
	
	   MzMessage message=new MzMessage();
	   message.setInQu(inQu);
	   message.setBody(obj);
	   message.setHandle(inHandle);
	   try{
		   outQu.put(message); 
	   }catch(Exception e){
		   e.printStackTrace();
	   }
	   
   }

   public void waitif(){
	   synchronized (inHandle) {
		   try{
			   if(outQu.size()>=6){
				   inHandle.wait(30000l);
			   }
			 
		   }catch(Exception e){
			   
		   }
		  
	   }
   }
   
   
   public void noitifyif(){
	   synchronized (inHandle) {
		   try{
			   if(outQu.size()<=3){
				   inHandle.notifyAll();;  
			   }
			 
		   }catch(Exception e){
			   
		   }
		  
	   }
   }
   
public String getKey() {
	return key;
}

public void setKey(String key) {
	this.key = key;
}

public LinkedBlockingQueue getInQu() {
	return inQu;
}

public void setInQu(LinkedBlockingQueue inQu) {
	this.inQu = inQu;
}

public LinkedBlockingQueue getOutQu() {
	return outQu;
}

public void setOutQu(LinkedBlockingQueue outQu) {
	this.outQu = outQu;
}

public MzHandle getInHandle() {
	return inHandle;
}

public void setInHandle(MzHandle inHandle) {
	this.inHandle = inHandle;
}
   
   

}
